<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>

<c:set var="ctx" value="${pageContext.request.contextPath}" scope="request"/>

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>登录</title>
		<jsp:include page="common.jsp"></jsp:include>
		<link href="${ctx }/resources/auth/css/login.css" rel="stylesheet">
	</head>

	<body style=" margin: 0; padding:0; font-family: 微软雅黑;">
	<div style=" background-color: #57b1ef; height:95px; width:100%;">
		<div style=" width: 960px; padding-left: 64px; height:95px; padding-top:17px; margin:0 auto;">
			<img src="${ctx }/resources/auth/img/logo.png" />
		</div>
	</div>
	<div style=" width:1024px; margin:0 auto; padding-top: 80px; padding-left: 30px;">
		<img style=" width: 544px; height:384px; float:left;" src="${ctx }/resources/auth/img/advertising.png"  />
		<div style=" padding-left: 30px; width:305px; padding-top:10px; float: left;">
			<form id="loginForm" method="post" action="${ctx }/login">
	            <div class="control-group">
	                <c:if test="${not empty message}">
			      		<div class="ui-widget result">
		                  <div class="ui-state-error ui-corner-all">
		                    <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
		                    <strong>错误:</strong>${message }</p>
		                  </div>
		                </div>
		      		</c:if>
	            </div>
	            <div class="syf_top">请登录后进行操作</div>
	            
	            <div class="syf_name syf_input">
	            	账　号：<input type="text" id="loginName" name="loginName" value="${loginName }">
	            </div>
	            <div class="syf_pwd syf_input">
	            	密　码：<input type="password" id="password" name="password">
	            </div>
	            <div class="syf_checkcode syf_input">
		           	 验证码：<input type="text" id="captchaCode" name="captchaCode" maxlength="4" style="width:73px;">
			        <img id="checkimg" src="${ctx }/captcha-image"><i class="icon-refresh" style="margin-left: 5px; cursor: pointer;" title="点击刷新"></i>
	            </div>
				<div class="syf_commit" onmousedown="down();" onmouseup="up();">登录</div>
          </form>
		</div>
	</div>
	<div style=" position:fixed; bottom:0px; width:100%; padding-top:10px; height: 30px; clear:both; color:#9e9e9e; background-color: #F2F1F1; text-align: center;">
	lingxiiflytek &nbsp;v1.0beta &nbsp;@版权所有&nbsp; 安徽科大讯飞信息科技股份有限公司
	</div>
	</body>
		
	<script type="text/javascript">
		$(document).ready(function() {
			
			$("#loginName").focus();
			
			$(".icon-refresh").click(function(){
				$("#checkimg").attr('src',$("#checkimg").attr('src')+"?t="+Math.random());
			});
			$("input").keypress(function(event){
				if(event.which == 13){
					doLogin();
				}
			});
		});
		
		function doLogin(){
			$("#loginForm").submit();
		}
		
		function down(){
			$(".syf_commit").css("background-image","url(${ctx}/resources/auth/img/button_register_press.png)");
		}
		function up(){
			$(".syf_commit").css("background-image","url(${ctx}/resources/auth/img/button_register.png)");
			doLogin();
		}
	</script>
</html>
